﻿using Ping9719.WpfEx.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;

namespace BaseUi.ViewModel
{
    public class ImageListenerViewModel : BindableBase
    {
        #region MyRegion
        private BitmapFrame ImageSource_;
        public BitmapFrame ImageSource { get => ImageSource_; set { SetProperty(ref ImageSource_, value); } }

        public double ImageWidth { get; set; }
        public double ImageHeight { get; set; }
        #endregion

        #region 变换
        private double ScaleXY_ = 1;

        public double ScaleXY { get => ScaleXY_; set { SetProperty(ref ScaleXY_, value); } }

        private double CenterX_;

        public double CenterX { get => CenterX_; set { SetProperty(ref CenterX_, value); } }

        private double CenterY_;

        public double CenterY { get => CenterY_; set { SetProperty(ref CenterY_, value); } }

        private double TranslateX_;

        public double TranslateX { get => TranslateX_; set { SetProperty(ref TranslateX_, value); } }

        private double TranslateY_;

        public double TranslateY { get => TranslateY_; set { SetProperty(ref TranslateY_, value); } }

        /// <summary>
        /// 自适应大小
        /// </summary>
        public void ImgAutoSize()
        {
            ScaleXY = 1;
            CenterX = 0;
            CenterY = 0;
            TranslateX = 0;
            TranslateY = 0;
        }
        #endregion
    }
}
